<script setup>
import { ref } from "vue";

const modelValue = defineModel();
const onClick = () => {
  //直接子这里就可以改
  modelValue.value = "是啊，没错";
};
const lookAll = () => {
  console.log(modelValue.value);
};
</script>

<template>
  <div>{{ modelValue }}</div>
  <input type="text" v-model="modelValue" />
  <button @click="onClick">点击</button>
  <button @click="lookAll">查看所有</button>
</template>

<style scoped lang="scss"></style>
